package commandPattern;

public class Client {

    protected final static Order order = new Order();

    public static void main(String[] args) {
        order.setDingTable(1);
        order.setFoodDir("西红柿炒蛋", 1);
        order.setFoodDir("红烧肉", 1);


        /*OrderCommand orderCommand = new OrderCommand(seniorChef, order);
        OrderCommand orderCommand1 = new OrderCommand(seniorChef, order1);

        Waitor waitor = new Waitor();
        waitor.setCommands(orderCommand);
        waitor.setCommands(orderCommand1);
        // 调用者调用
        waitor.orderUp();*/

        Waitor waitor = new Waitor();
//        waitor.orderUp(new SeniorChef());
        waitor.orderUp(order->{
            System.out.println(order.getDingTable() + "桌订单：");
            for (String s : order.getFoodDir().keySet()) {
                System.out.println(order.getFoodDir().get(s) + "份" + s);
            }
        });
    }
}
